<?php
namespace Opportunity\Model;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Opportunity //implements InputFilterAwareInterface
{
    public $id;
	public $name;
    public $amount_currency_id;
    public $amount_value;
    public $account_id;
    public $closedate;
    public $stage_id;
    public $probability;
    public $source_id;
    public $description;
    
    public function exchangeArray($data)
    {
        $this->id     = (isset($data['id'])) ? $data['id'] : null;
        $this->name = (isset($data['name'])) ? $data['name'] : null;
        $this->amount_currency_id  = (isset($data['amount_currency_id'])) ? $data['amount_currency_id'] : null;
		$this->amount_value  = (isset($data['amount_value'])) ? $data['amount_value'] : null;
		$this->account_id  = (isset($data['account_id'])) ? $data['account_id'] : null;
		$this->closedate  = (isset($data['closedate'])) ? $data['closedate'] : null;
		$this->stage_id  = (isset($data['stage_id'])) ? $data['stage_id'] : null;
		$this->probability  = (isset($data['probability'])) ? $data['probability'] : null;
		$this->source_id  = (isset($data['source_id'])) ? $data['source_id'] : null;
		$this->description  = (isset($data['description'])) ? $data['description'] : null;	
    }
	
	public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
        
    public function getArrayCopy()
     {
         return get_object_vars($this);
     }
	
	protected $inputFilter; 
    
    public function setInputFilter(InputFilterInterface $inputFilter) 
    { 
        throw new \Exception("Not used"); 
    } 
    
    public function getInputFilter() 
    { 
        if (!$this->inputFilter) 
        { 
            $inputFilter = new InputFilter(); 
            $factory = new InputFactory(); 
            
        
        $inputFilter->add($factory->createInput(array(
            'name' => 'name', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
           
        ))); 
 
        $inputFilter->add($factory->createInput(array(
            'name' => 'amount_currency_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'amount_value', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
 
                $inputFilter->add($factory->createInput(array(
            'name' => 'account_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'closedate', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
        
                $inputFilter->add($factory->createInput(array(
            'name' => 'stage_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 

                $inputFilter->add($factory->createInput(array(
            'name' => 'probability', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        )));
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'source_id', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
            
        ))); 
                
                $inputFilter->add($factory->createInput(array(
            'name' => 'description', 
            'required' => true, 
            'filters' => array( 
                array('name' => 'StripTags'), 
                array('name' => 'StringTrim'), 
            ), 
             
        ))); 
                        $this->inputFilter = $inputFilter;
        }

        return $this->inputFilter;
    }
}